import React, { useState } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import HomeScreen from './HomeScreen/HomeScreen';
import InfoMation from './InfoMation/InfoMaTion'
import Personage from './Personage/Personage';
import { FontAwesome } from 'react-native-vector-icons';
import Login from './Login/Login';
<<<<<<< HEAD
import Jifen from './Personage/Jifen'
import ClassList from './ClassList/Class_list'
import ClassListtwo from './ClassList/ClassList'
import ClassKao from './ClassList/ClassXiazai';
import ClassXiazai from './ClassList/ClassXiazai';
import PointsMall from './points/index'
import DocumentList from './studyInformation/index'
import DetailPages from './points/DetailPages'
import Missing from './Login/Missing'
=======
import Jifen from './Personage/Jifen';
import ClassList from './ClassList/Class_list'
import ClassKao from './ClassList/ClassKao';
import ClassXiazai from './ClassList/ClassXiazai';
import PointsMall from './points/index';
import DocumentList from './studyInformation/index';
import DetailPages from './points/DetailPages';
import Missing from './Login/Missing';


// 消息页面的配置项
const MessageOptions = {
  headerTitle: "消息",
  headerStyle: { height: '42px' },
  headerTitleStyle: {
    fontWeight: 'bold', // 设置标题的字体粗细
    fontSize: 18, // 设置字体大小
    color: 'black', // 设置字体颜色
  }
}
// 首页的配置项
const HomeOptions = {
  headerTitle: "首页",
  headerStyle: { height: '42px' },
  headerTitleStyle: {
    fontWeight: 'bold', // 设置标题的字体粗细
    fontSize: 18, // 设置字体大小
    color: 'black', // 设置字体颜色
  }
}


>>>>>>> ed98397d74490d5aa3ef211fdf90e69d5ee25c73

export default function App() {
  const Tab = createBottomTabNavigator();
  const Stack = createStackNavigator();

  const linking = {
    prefixes: ['http://localhost:3000/home'], // 设置前缀
    config: {
      screens: {
        Home: '',
        '我的课程':'list',
        '我的考试':'kaoshi',
        '我的下载':'xiazai',
        Login: 'login',
        '首页': 'home',
        '消息': 'message',
        '我的': 'profile',
        Jifen: 'Jifen',
        '积分商城':'points',
        '学习资料':'study',
      },
    },
  };
  const TabPage = () => {
    return (
      <Tab.Navigator
        screenOptions={({ route }) => ({
          tabBarIcon: ({ focused, color, size }) => {
            let iconName;
            if (route.name === '首页') {
              iconName = 'home';
            } else if (route.name === '消息') {
              iconName = focused ? 'bell' : 'bell';
            } else if (route.name === '我的') {
              iconName = focused ? 'user' : 'user';
            }
            return <FontAwesome name={iconName} size={size} color={color} />;
          },
        })}
      >
        <Tab.Screen name="首页" component={HomeScreen} options={HomeOptions} />
        <Tab.Screen name="消息" component={InfoMation} options={MessageOptions} />
        <Tab.Screen name="我的" component={Personage} options={{ headerShown: false }} />
        
      </Tab.Navigator>
    );
  }


  return (
    <NavigationContainer linking={linking}>
      <Stack.Navigator>
        <Stack.Screen name='Home' component={TabPage} options={{ headerShown: false }} />
        <Stack.Screen name='Login' component={Login} options={{ headerShown: false }} />
        <Stack.Screen name='我的课程' component={ClassList} options={{ headerShown: false }} />
        <Stack.Screen name='我的考试' component={ClassKao} options={{ headerShown: false }} />
        <Stack.Screen name='我的下载' component={ClassXiazai} options={{ headerShown: false }} />
        <Stack.Screen name='积分商城' component={PointsMall} options={{ headerShown: false }} />
        <Stack.Screen name='学习资料' component={DocumentList} options={{ headerShown: false }} />
        <Stack.Screen name='详情' component={DetailPages} options={{ headerShown: true }} />
        <Stack.Screen name='Missing' component={Missing} options={{ headerShown: false }} />
        <Tab.Screen name="Jifen" component={Jifen} options={{ headerShown: false }} />
      </Stack.Navigator>
    </NavigationContainer>
  );
}
